Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOBILESDK 2686] When “Set as default” checkbox is checked, set set_as_default_payment_method on PaymentIntent/SetupIntent #10219

Merged
merged 15 commits into from
Feb 20, 2025

Conversation

tianzhao-stripe
Copy link
Contributor

@tianzhao-stripe tianzhao-stripe commented Feb 19, 2025

Summary

  • Created PaymentMethodExtraParams for Card and USBankAccount
  • Added PaymentMethodExtraParams to PaymentMethodConfirmationOption.New
  • Reading extraParams from PaymentMethodConfirmationOption.New to IntentConfirmationInterceptor, and passing value to ConfirmPaymentIntentParams and ConfirmSetupIntentParams
  • Added setAsDefaultPaymentMethod to ConfirmPaymentIntentParams and ConfirmSetupIntentParams,
  1. FormElement ->
  2. PaymentMethodExtraParams ->
  3. transformToPaymentMethodExtraParams ->
  4. PaymentSelection.New.Card ->
  5. PaymentMethodConfirmationOption.New ->
  6. IntentConfirmationInterceptor ->
  7. ConfirmPaymentIntentParams and ConfirmSetupIntentParams

Motivation

Pass the value of set_as_default_payment_method to PaymentIntent and SetupIntent.

https://jira.corp.stripe.com/browse/MOBILESDK-2684
https://jira.corp.stripe.com/browse/MOBILESDK-2686

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

N.A.

Changelog

N.A.

Copy link
Contributor

github-actions bot commented Feb 19, 2025

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │            compressed            │          uncompressed          
          ├───────────┬───────────┬──────────┼──────────┬──────────┬──────────
 APK      │ old       │ new       │ diff     │ old      │ new      │ diff     
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
      dex │   4.1 MiB │   4.1 MiB │   +1 KiB │    9 MiB │    9 MiB │ +2.8 KiB 
     arsc │   2.4 MiB │   2.4 MiB │      0 B │  2.4 MiB │  2.4 MiB │      0 B 
 manifest │   5.1 KiB │   5.1 KiB │      0 B │ 25.7 KiB │ 25.7 KiB │      0 B 
      res │ 910.9 KiB │ 910.9 KiB │      0 B │  1.4 MiB │  1.4 MiB │      0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │    6 MiB │    6 MiB │      0 B 
    asset │   1.6 MiB │   1.6 MiB │    +23 B │  1.6 MiB │  1.6 MiB │    +23 B 
    other │   1.4 MiB │   1.4 MiB │     +2 B │  1.6 MiB │  1.6 MiB │      0 B 
──────────┼───────────┼───────────┼──────────┼──────────┼──────────┼──────────
    total │  12.9 MiB │  12.9 MiB │ +1.1 KiB │ 22.1 MiB │ 22.1 MiB │ +2.8 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 42714 │ 42723 │  +9 (+52 -43)     
   types │ 15326 │ 15331 │  +5 (+44 -39)     
 classes │ 12936 │ 12939 │  +3 (+7 -4)       
 methods │ 62587 │ 62604 │ +17 (+1795 -1778) 
  fields │ 41578 │ 41590 │ +12 (+1384 -1372) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  243 │  243 │  0   
 entries │ 6267 │ 6267 │  0
APK
     compressed      │     uncompressed     │                                
──────────┬──────────┼───────────┬──────────┤                                
 size     │ diff     │ size      │ diff     │ path                           
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  4.1 MiB │   +1 KiB │     9 MiB │ +2.8 KiB │ ∆ classes.dex                  
  8.1 KiB │    +29 B │     8 KiB │    +29 B │ ∆ assets/dexopt/baseline.prof  
    1 KiB │     -6 B │     919 B │     -6 B │ ∆ assets/dexopt/baseline.profm 
  1.2 KiB │     +1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA            
 50.6 KiB │     +1 B │ 119.9 KiB │      0 B │ ∆ META-INF/MANIFEST.MF         
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  4.1 MiB │ +1.1 KiB │   9.1 MiB │ +2.8 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   42714 │ 42723 │ +9 (+52 -43) 
  
  + , setAsDefaultPaymentMethod=
  + Card(setAsDefault=
  + LLLLLLLZ
  + LLLLLLZL
  + LLLLLLZLL
  + LW6/w3;
  + LW6/x3;
  + LW6/y3;
  + Lb6/q;
  + Ld2/P;
  + Lp/n1;
  + Lq1/p;
  + USBankAccount(setAsDefault=
  + VLLLLLLLZLLLLLLL
  + [LW6/L2;
  + [LW6/a3;
  + [LW6/b2;
  + [LW6/f3;
  + [LW6/h3;
  + [LW6/l3;
  + [LW6/m3;
  + [LW6/n3;
  + [LW6/o2;
  + [LW6/v2;
  + [LW6/w3;
  + [LW6/x3;
  + [LW6/y3;
  + [Lb6/g;
  + [Lb6/i;
  + [Lb7/I;
  + [Lb7/N;
  + [Lb7/W;
  + [Lb7/l;
  + [Lb7/n;
  + [Ld2/N;
  + [Ld2/l;
  + [Ld2/y;
  + [Le7/a;
  + [Lg6/E2;
  + [Lg6/Q;
  + [Lg6/U;
  + [Lg6/y2;
  + [Ll8/B;
  + [Ll8/E;
  + [Ll8/N;
  + [Ll8/a;
  + [Lp/N;
  + [Lp/d1;
  + [Lr9/l;
  + [Lv8/f;
  + [Lz8/f;
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"71b04d5","r8-mode":"full","version":"8.8.27"}
  
  - LLLLLLZ
  - LLLLLZLL
  - Lb7/Z;
  - Le7/b;
  - Ll2/P;
  - Ll8/W;
  - VLLLLLLLZLLLLLL
  - [LW6/O2;
  - [LW6/X1;
  - [LW6/d3;
  - [LW6/g3;
  - [LW6/j3;
  - [LW6/k2;
  - [LW6/p3;
  - [LW6/q3;
  - [LW6/r2;
  - [LW6/r3;
  - [LW6/w2;
  - [Lb6/f;
  - [Lb6/h;
  - [Lb7/J;
  - [Lb7/O;
  - [Lb7/Y;
  - [Lb7/m;
  - [Lb7/o;
  - [Ld2/M;
  - [Ld2/k;
  - [Ld2/x;
  - [Le7/b;
  - [Lg6/D2;
  - [Lg6/P;
  - [Lg6/T;
  - [Lg6/x2;
  - [Ll8/D;
  - [Ll8/F;
  - [Ll8/O;
  - [Ll8/c;
  - [Lp/M;
  - [Lp/c1;
  - [Lr9/j;
  - [Lv8/d;
  - [Lz8/d;
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"1e909ca","r8-mode":"full","version":"8.8.27"}
  

TYPES:

   old   │ new   │ diff         
  ───────┼───────┼──────────────
   15326 │ 15331 │ +5 (+44 -39) 
  
  + LW6/w3;
  + LW6/x3;
  + LW6/y3;
  + Lb6/q;
  + Ld2/P;
  + Lp/n1;
  + Lq1/p;
  + [LW6/L2;
  + [LW6/a3;
  + [LW6/b2;
  + [LW6/f3;
  + [LW6/h3;
  + [LW6/l3;
  + [LW6/m3;
  + [LW6/n3;
  + [LW6/o2;
  + [LW6/v2;
  + [LW6/w3;
  + [LW6/x3;
  + [LW6/y3;
  + [Lb6/g;
  + [Lb6/i;
  + [Lb7/I;
  + [Lb7/N;
  + [Lb7/W;
  + [Lb7/l;
  + [Lb7/n;
  + [Ld2/N;
  + [Ld2/l;
  + [Ld2/y;
  + [Le7/a;
  + [Lg6/E2;
  + [Lg6/Q;
  + [Lg6/U;
  + [Lg6/y2;
  + [Ll8/B;
  + [Ll8/E;
  + [Ll8/N;
  + [Ll8/a;
  + [Lp/N;
  + [Lp/d1;
  + [Lr9/l;
  + [Lv8/f;
  + [Lz8/f;
  
  - Lb7/Z;
  - Le7/b;
  - Ll2/P;
  - Ll8/W;
  - [LW6/O2;
  - [LW6/X1;
  - [LW6/d3;
  - [LW6/g3;
  - [LW6/j3;
  - [LW6/k2;
  - [LW6/p3;
  - [LW6/q3;
  - [LW6/r2;
  - [LW6/r3;
  - [LW6/w2;
  - [Lb6/f;
  - [Lb6/h;
  - [Lb7/J;
  - [Lb7/O;
  - [Lb7/Y;
  - [Lb7/m;
  - [Lb7/o;
  - [Ld2/M;
  - [Ld2/k;
  - [Ld2/x;
  - [Le7/b;
  - [Lg6/D2;
  - [Lg6/P;
  - [Lg6/T;
  - [Lg6/x2;
  - [Ll8/D;
  - [Ll8/F;
  - [Ll8/O;
  - [Ll8/c;
  - [Lp/M;
  - [Lp/c1;
  - [Lr9/j;
  - [Lv8/d;
  - [Lz8/d;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   62587 │ 62604 │ +17 (+1795 -1778) 
  
  + A6.d <init>(z, b, V)
  + A6.d F(w, b, String) → l
  + A6.d P(y) → i
  + A7.J1 <init>(o1, b, v, m, u, b, CoroutineContext, g0, K, O, s, f, a)
  + A7.J1 A(N, ContinuationImpl) → Object
  + A7.J1 B(N, ContinuationImpl) → Object
  + A7.J1 w(J1, y)
  + A7.J1 y(p3, k, boolean)
  + A7.L <init>(n, h)
  + A7.P d() → X1
  + A7.Q d() → X1
  + A7.S d() → X1
  + A7.T <init>(N, J0, boolean, Set)
  + A7.c2 <init>(j2, D1, b, Function1, Continuation)
  + A7.f a(b)
  + A7.o1 <init>(D, J0, Integer, boolean)
  + A7.r j(D, J0)
  + B5.n <init>(T0, t3)
  + B7.f <init>(E, AddressElementActivity, int)
  + B7.n <init>(g)
  + C6.f <init>(g, e, e)
  + C6.h <init>(g, g)
  + C8.f <init>(r)
  + D7.p <init>(x, D, ArrayList, Duration, K0, boolean, boolean, boolean)
  + D8.a L(z, boolean)
  + D8.a S(p3, Y0, boolean)
  + E7.a a(p3, D) → boolean
  + E7.a c(p3, D1, D) → boolean
  + G2.h c() → j1
  + G2.j d(p3, int) → String
  + G5.o c(Throwable, x3) → Throwable
  + H1.b0 g(v) → String[]
  + H6.B <init>(E, u, y1, Function3, Function1, Function1, Function2, Function1, Function0, Function0, Function0, Function0, Function0, int)
  + H6.D <init>(E, Function0, Function0, Function1, Function1, Function1, Function1, Function0, Function0, Function0, int)
  + H6.L <init>(Function1, u, Function0, c, y1, Function1, E, Function0, Function0, Function2, Function1, Function0, Function0)
  + H6.M <init>(Function3, y1, Function1, u, Function0, c, Function1, E, Function0, Function0, Function2, Function1, Function0, Function0, int)
  + H6.X c(p3) → b
  + H6.p <init>(E, u, y1, Function1, Function2, Function1, Function0, Function0, Function0, Fun
...✂

@tianzhao-stripe tianzhao-stripe merged commit 9703f18 into master Feb 20, 2025
16 checks passed
@tianzhao-stripe tianzhao-stripe deleted the MOBILESDK-2686 branch February 20, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants